# -*- coding: utf-8 -*-
from airflow.operators.dummy_operator import DummyOperator
from utils.operators.external_dag_sensor import ExternalDagSensor,ExternalDagSensorAsync

spmi_dwd__dwd_spmi_operation_change_fee_bill_base_dt = ExternalDagSensorAsync(
    task_id='spmi_dwd__dwd_spmi_operation_change_fee_bill_base_dt',
    external_dag_id='spmi',  # 需要等待的外部DAG id
    external_task_id='spmi_dwd__dwd_spmi_operation_change_fee_bill_base_dt',  # 需要等待的外部Task id，可以为None
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


spmi_dwd__dwd_spmi_piece_change_fee_bill_base_dt = ExternalDagSensorAsync(
    task_id='spmi_dwd__dwd_spmi_piece_change_fee_bill_base_dt',
    external_dag_id='spmi',  # 需要等待的外部DAG id
    external_task_id='spmi_dwd__dwd_spmi_piece_change_fee_bill_base_dt',  # 需要等待的外部Task id，可以为None
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

# 暂时还没上线  等昆明
spmi_dwd__dwd_spmi_transfer_change_fee_bill_base_dt = ExternalDagSensorAsync(
    task_id='spmi_dwd__dwd_spmi_transfer_change_fee_bill_base_dt',
    external_dag_id='spmi',  # 需要等待的外部DAG id
    external_task_id='spmi_dwd__dwd_spmi_transfer_change_fee_bill_base_dt',  # 需要等待的外部Task id，可以为None
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

# ##派件费账单表
spmi_dwd__dwd_spmi_piece_bill_new_dt_part1 = ExternalDagSensorAsync(
    task_id='spmi_dwd__dwd_spmi_piece_bill_new_dt_part1',
    external_dag_id='spmi',  # 需要等待的外部DAG id
    external_task_id='spmi_dwd__dwd_spmi_piece_bill_new_dt_part1',  # 需要等待的外部Task id，可以为None
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

# ##派件费账单表
spmi_dwd__dwd_spmi_piece_bill_new_dt_part2 = ExternalDagSensorAsync(
    task_id='spmi_dwd__dwd_spmi_piece_bill_new_dt_part2',
    external_dag_id='spmi',  # 需要等待的外部DAG id
    external_task_id='spmi_dwd__dwd_spmi_piece_bill_new_dt_part2',  # 需要等待的外部Task id，可以为None
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)